{% extends "dashboard/base.html" %}
{% load machine_services %}

{%block content %}
{% if success %}
    <div class="alert alert-success">
        <center><p>Action: {{action}} was successful!</p></center>
    </div>
{%endif%}
{% if success == "False" %}
    <div class="alert alert-warning">
        <center><p>Action: {{action}} was unsuccessful!</p></center>
    </div>
{%endif%}
        
<div class="container">
    <h3>{{machine.hostname}}->{{service}}</h3>
<table class="table table-bordered">
    {% show_service_details machine service %}
</table>
    <center>
    <div class="btn-group">
            <a href="/postrequest/?action=start&machine={{machine.id}}&service={{service}}" class="btn btn-success">Start Service</a>
            <a href="/postrequest/?action=stop&machine={{machine.id}}&service={{service}}" class="btn btn-danger">Stop Service</a>
    </div>
    <div class="btn-group">
            <a href="/postrequest/?action=monitor&machine={{machine.id}}&service={{service}}" class="btn btn-success">Monitor Service</a>
            <a href="/postrequest/?action=unmonitor&machine={{machine.id}}&service={{service}}" class="btn btn-warning">Unmonitor Service</a>
    </div>
    </center>
</div>
{%endblock%}
